package com.simple.weixin.service.impl;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.simple.core.base.BaseApiService;
import com.simple.core.base.BaseResponse;
import com.simple.weixin.dto.output.AppOutDTO;
import com.simple.weixin.service.WeiXinAppService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class WeiXinAppServiceImpl extends BaseApiService<AppOutDTO> implements WeiXinAppService {

    @Value("${server.port}")
    private int port;


    @HystrixCommand(fallbackMethod = "defaultApp")
    @Override
    public BaseResponse<AppOutDTO> getApp() {
        int i = 1/0;
        return setResultSuccess(new AppOutDTO("634844669","罗小黑@634844669-->" + port));
    }


    public BaseResponse<AppOutDTO> defaultApp() {
        return setResultSuccess(new AppOutDTO("634844669@default","罗小黑@634844669-->" + port));
    }





}
